<!-- 免责 -->
<template name="user-agreement-popup">
  <view class="texttaa" style="padding: 10px">
    <view class="texts">
      <rich-text :nodes="nodeeStr"></rich-text>
    </view>
  </view>
</template>

<script>
export default {
  name: 'user-agreement-popup',
  data() {
    return { nodeeStr: '' }
  },

  onLoad(e) {
    this.getData(e.type)
    if (e.type === '1') {
      uni.setNavigationBarTitle({
        title: '隐私政策',
      })
    }
  },

  methods: {
    async getData(type) {
      try {
        let res
        if (type === '1') {
          res = await this.$api.jsonData.getPrivacyAgreement()
        } else {
          res = await this.$api.jsonData.getUuserAgreement()
        }
        console.log(res)
        this.nodeeStr = res.data.data
      } catch (error) {
        console.log(error)
      }
    },
  },
}
</script>
